Reference generator: can I build one in MS Office?
I'm trying to build a 'reference generator' which takes users' inputs (author, title, year etc.) and spits out a full reference/citation in a specific format.
The references must be in a bespoke format, which is why I can't use existing online tools. It has to include unique fonts for different fields (i.e. book title must be italicised), and it also must permit users to add a hyperlink to specific fields (e.g. for a web article, I want the title to be a clickable hyperlink). Finally, it must be in a user-friendly format. All users have access to MS Office so an Excel or Access template might be perfect, but an online version which sits on our work intranet may also work.
Has anyone done something like this before? Any recommendations or templates? My IT skills are next to zero - I tried an Excel concatenate table which got me some of the way, but can't accommodate font changes or hyperlinking text. All help greatly appreciated - thanks.
do you know?
how many words do you know
See also questions close to this topic
-
Creating Sticky Navbar with Drop Down Menu HTML
I am creating a HTML web page which contains a sticky navbar with drop down menu. However, when I created one, the dropdown menu does not works in the sticky navbar and so goes vise versa. below is the screenshot of both the result of the two codes.
*image with dropdown menu but without sticky navbar
*image with sticky navbar but without dropdown menu
below is the code for "image with dropdown menu but without sticky navbar"
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font- awesome/4.7.0/css/font-awesome.min.css"> <style> body {margin:0;font-family:Arial} .topnav { overflow: hidden; background-color: #333; } .topnav a { list-style-type: none; float: left; display: block; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; position: sticky; } .active { background-color: #04AA6D; color: white; } .topnav .icon { display: none; } .dropdown { float: left; overflow: hidden; } .dropdown .dropbtn { font-size: 17px; border: none; outline: none; color: white; padding: 14px 16px; background-color: inherit; font-family: inherit; margin: 0; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { float: none; color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } .topnav a:hover, .dropdown:hover .dropbtn { background-color: #555; color: white; } .dropdown-content a:hover { background-color: #ddd; color: black; } .dropdown:hover .dropdown-content { display: block; } @media screen and (max-width: 600px) { .topnav a:not(:first-child), .dropdown .dropbtn { display: none; } .topnav a.icon { float: right; display: block; } } @media screen and (max-width: 600px) { .topnav.responsive {position: relative;} .topnav.responsive .icon { position: absolute; right: 0; top: 0; } .topnav.responsive a { float: none; display: block; text-align: left; } .topnav.responsive .dropdown {float: none;} .topnav.responsive .dropdown-content {position: relative;} .topnav.responsive .dropdown .dropbtn { display: block; width: 100%; text-align: left; } } </style> </head> <body> <div class="header"> <h2>Scroll Down</h2> <p>Scroll down to see the sticky effect.</p> </div> <div class="topnav" id="myTopnav"> <a href="#home" class="active">Home</a> <a href="#news">News</a> <a href="#contact">Contact</a> <div class="dropdown"> <button class="dropbtn">Dropdown <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </div> <a href="#about">About</a> <a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">☰</a> </div> <div style="padding-left:16px"> <h2>Responsive Topnav with Dropdown</h2> <p>Resize the browser window to see how it works.</p> <p>Hover over the dropdown button to open the dropdown menu.</p> </div> <h3>Sticky Navigation Bar Example</h3> <p>The navbar will <strong>stick</strong> to the top when you reach its scroll position.</p> <p><strong>Note:</strong> Internet Explorer do not support sticky positioning and Safari requires a -webkit- prefix.</p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <script> function myFunction() { var x = document.getElementById("myTopnav"); if (x.className === "topnav") { x.className += " responsive"; } else { x.className = "topnav"; } } </script> </body> </html>
below is the code for "image with sticky navbar but without dropdown menu"
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font- awesome/4.7.0/css/font-awesome.min.css"> <style> body { font-size: 20px; } body {margin:0;} ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; position: -webkit-sticky; /* Safari */ position: sticky; top: 0; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 16px 20px; text-decoration: none; } li a:hover { background-color: #111; } /*======================================================================*/ body { background-color:white; } ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #38444d; } li { float: left; } li a, .dropbtn { display: inline-block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover, .dropdown:hover .dropbtn { background-color: red; } li.dropdown { display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } .dropdown-content a:hover {background-color: #f1f1f1;} .dropdown:hover .dropdown-content { display: block; } footer { text-align: center; padding: 3px; background-color: DarkSalmon; color: white; } </style> </head> <body> <div class="header"> <h2>Scroll Down</h2> <p>Scroll down to see the sticky effect.</p> </div> <ul> <li><a href="#home">Home</a></li> <li><a href="#news">News</a></li> <li class="dropdown"> <a href="javascript:void(1)" class="dropbtn">Dropdown</a> <div class="dropdown-content"> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </li> </ul> <h3>Sticky Navigation Bar Example</h3> <p>The navbar will <strong>stick</strong> to the top when you reach its scroll position.</p> <p><strong>Note:</strong> Internet Explorer do not support sticky positioning and Safari requires a -webkit- prefix.</p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <p>Some text to enable scrolling. </p> <footer> <p>Author: Hege Refsnes<br> <a href="mailto:hege@example.com">hege@example.com</a></p> </footer> </body> </html>
Please i need some help with this as i am new to html and css.
-
Javascript: Change element class if button has a certain value
<div class="main-div main-div2"> <!-- IF up to date, main-div3 --> <button id="update-btn" class="btn update-btn"> Up to date </button> </div>
I want to make it so if update-btn has a value of "Up to date", change the div class from "main-div main-div2" to "main-div main-div3". Otherwise, if it's any other value, change it to "main-div main-div2"
What kind of loop would be good for this Javascript function too if I want it to be checking constantly?
Thank you.
-
Boostrap vertical sizing with different style width and height
I am trying to set verticaly icon on profile photo card inside div to be in the middle in white box(div), but dont know why it doesnt works. When I use
style="width: 300px; height: 300px;
for div square I can center it on horizontaly, but not verticaly :/ Can someone explain me what I am doing wrong?Anyway is there any way how to resize bootstrap icons except display-1???
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css"> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> <div class="container-sm offset-md"> <h1 class="p-4 m-4">Nastavení profilu</h1> <div class="row"> <div class="col"> <div class="card p-4 m-4"> Osobní údaje <input type="text" name="name" class="form-control" placeholder="Jméno"> <input type="text" name="surname" class="form-control" placeholder="Příjmení"> <input type="email" name="email" class="form-control" placeholder="E-Mail"> <input type="date" name="name" class="form-control"> </div> </div> <div class="col-4"> <div class="card p-4 m-4 bg-light"> Profilová fotografie <div class=" square text-center border display-1 m-3 bg-white mx-auto"> <i class="bi bi-person-fill align-middle justify-content-center text-secondary"></i> </div> <input type="file" id="customFile" name="file" hidden=""> <div class="text-center"> <button class="btn btn-success" for="customFile">Nahrát</button> <button type="button" class="btn btn-danger">Smazat</button> <p class="text-muted mt-3 mb-0">Poznámka: Minimální velikost 300px x 300px</p> </div> </div> </div> </div> <div class="row"> <div class="col"> <div class="card p-4 m-4"> Změna hesla </div> </div> <div class="col"> <div class="card p-4 m-4"> Zobrazit/skrýt podrobnosti </div> </div> </div> </div>
-
.Body & .HTMLBody Indent and Default Signature Issue
I've set up a macro to send an e-mail through Outlook.
.Body is read from a cell inside the file with indents. Since the value will change depending on the usage, I need to reference that cell for the body.
However, there rises 2 issues using .HTMLbody I lose indents which are constructed with CHAR(10) but I keep the default HTML signature.
When using just .BODY indents are displayed are correctly however the default signature is not constructed as HTML and I lose the images.
How should I go about fixing this issue?
My code:
sig = .HTMLBody body = xlSht.Range("B4").Value .To = xlSht.Range("B2").Value .CC = "" .Subject = xlSht.Range("B1").Value .body = body & sig .Display
I'd really appreciate your assistance.
Thanks.
-
Yahoo Finance no longer returns VBA cookie request for .getResponseHeader("Set-Cookie")
The following Excel VBA code segment has worked for years, but stopped working around 28 Apr 2022. I receive the responseText, but the .getResponseHeader("Set-Cookie") returns null.
Set httpReq = New WinHttp.WinHttpRequest DownloadURL = "https://finance.yahoo.com/lookup?s=" & stockSymbol With httpReq .Open "GET", DownloadURL, False .setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8" .Send .waitForResponse response = .responseText cookie = Split(.getResponseHeader("Set-Cookie"), ";")(0) End With
-
export excel rows to individual json files in python
My excel file has 500 rows of data. I am trying to get 500 individual JSON files. Each file should have data only from 1 row. Thank you in advance.
import json import pandas excel_data_df = pandas.read_excel("F:/2/N.csv.xlsx", sheet_name='Sheet1') json_str = excel_data_df.to_json(orient='records') for idx, row in enumerate(json_str): fpath = str(idx) + ".json" with open(fpath, "w+") as f: json.dump(row, f)
-
Fetch value and display to comboBox
Hi anyone can help me.
I want to retrieve data from my table and display it to combBox but i wont display. But when i switch to textBox it will display.
Code:
OleDbDataReader reader = cm.ExecuteReader(); while (reader.Read()) { dataGridView2.Rows.Add( reader["Employee Name"].ToString());
Datagridview:
private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { connection.Open(); OleDbCommand cm = new OleDbCommand(); cm.Connection = connection; cm.CommandText = query; OleDbDataReader reader = cm.ExecuteReader(); while (reader.Read()) { comboBox4.Text = dataGridView2.SelectedRows[0].Cells["Column8"].Value.ToString();
-
VBA QuickBooks: Class not registered
My long-time running MS Access application will no longer create QuickBooks invoices and is failing on the OpenConnection line with the following error:
HRESULT -2147221164 (8004154) Class not registered
My relevant code is:
Option Compare Database Public requestMsgSet As QBFC2Lib.IMsgSetRequest ' QB global variable Public booSessionBegun As Boolean ' QB global variable Public Response As QBFC2Lib.IResponse ' QB global variable Public responseMsgSet As QBFC2Lib.IMsgSetResponse ' QB global variable Public sessionManager As New QBFC2Lib.QBSessionManager ' QB global variable Public invoiceLineAdd As QBFC2Lib.IInvoiceLineAdd ' QB global variable Public invoiceAdd As QBFC2Lib.IInvoiceAdd ' QB global variable Public OrientIDHolder As Integer Public MultipleInvoice As Boolean ' QB global variable 'False until session is begun booSessionBegun = False ' Create the session manager object using QBFC 2.0, and use this ' object to open a connection and begin a session with QuickBooks. sessionManager.OpenConnection "AZENCODE02", "Database - QuickBooks invoice add" sessionManager.BeginSession "", QBFC2Lib.omDontCare booSessionBegun = True ' Session has begun
The error is in the
QuickBooks.sessionManager.OpenConnection
line but I cannot figure out what is happening. -
using DDE get a response from Python to VBA in MS Access
I have a need to pass strings back forth from a python script to a VBA application running in MS Access.
Communication from VBA to Python works great!
Communication from Python to VBA - not so great great...
The code runs without error, but I only get the 1st character of the response.
EX: Python returns "Joy" VBA only gets "J"
Keep in mind what is so frustrating is I can send strings from VBA to the Python script is no problem.
The Python DDE server:
import win32ui from pywin.mfc import object import dde class MySystemTopic(object.Object): def __init__(self): object.Object.__init__(self, dde.CreateServerSystemTopic()) def Exec(self, cmd): print("System Topic asked to exec", cmd) class recv_from_VBA_topic(object.Object): def __init__(self, topicName): object.Object.__init__(self, dde.CreateTopic(topicName)) def Exec(self, cmd): print("recv_VBA_CMD asked to exec", cmd) # print('sending back responce: ' + 'Dave is really great!!!!') class send_to_VBA_topic(object.Object): def __init__(self, topicName): topic = dde.CreateTopic(topicName) topic.AddItem(dde.CreateStringItem("")) object.Object.__init__(self, topic) def Request(self, aString): daLen = str(len(aString)) print("send_to_VBA_topic Request Topic asked to compute length of:", aString, daLen) return(daLen + ' : ' + aString) def main(): server = dde.CreateServer() server.AddTopic(MySystemTopic()) server.AddTopic(recv_from_VBA_topic("recv_VBA_CMD")) server.AddTopic(send_to_VBA_topic("send_to_VBA_topic")) server.Create('SDER_DDE') print('server: SDER_DDE\n Topic: recv_VBA_CMD\n Topic: send_to_VBA_topic\n') while 1: win32ui.PumpWaitingMessages(0, -1) if __name__ == "__main__": main()
The VBA code:
Option Compare Database Option Explicit Public Function dde_send(Optional strIn As String) As String Dim sRet As String Dim Blp As Long 'Blp = DDEInitiate("RunAny", "RunAnyCommand") Blp = DDEInitiate("SDER_DDE", "recv_VBA_CMD") If Not IsNull(strIn) Then Call DDEExecute(Blp, strIn) Else Call DDEExecute(Blp, "Greetings from VBA!") End If Call DDETerminate(Blp) dde_send = sRet End Function Public Function dde_recv(Optional strIn As String) As String Dim sRet As String Dim Blp As Long Dim vDDE As Variant, sDDE As String Blp = DDEInitiate("SDER_DDE", "send_to_VBA_topic") If Not IsNull(strIn) Then ' vDDE = DDERequest(Blp, strIn) sDDE = DDERequest(Blp, strIn) Debug.Print sDDE Else vDDE = DDERequest(Blp, "dde_recv test") End If DDETerminate (Blp) dde_recv = sDDE End Function
dde_send works dde_recv only gets the 1st character
NOTE: I tested the Python server with this code and it works for receiving the correct string back from the server.
import win32ui import dde #apparently "servers" talk to "servers" server = dde.CreateServer() #servers get names but I'm not sure what use this name #has if you're acting like a client server.Create("TestClient") #use our server to start a conversation conversation = dde.CreateConversation(server) # RunAny is the server name, and RunAnyCommand is the topic conversation.ConnectTo("SDER_DDE", "send_to_VBA_topic") # DoSomething is the command to execute # conversation.Exec("Dave is Great!") # For my case I also needed the request function # request somedata and save the response in requested_data. try: requested_data = conversation.Request("somedata") print(requested_data) except: print('conversation.Request: exception error')